#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi pair<ll, ll>
#define fi first
#define se second
#define N 111111
ll n, a[N], ans;
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%lld", &n);
    for(int i = 1 ; i <= n ; i++)
        scanf("%lld", &a[i]);
    sort(a + 1, a + 1 + n);
    ans = n;
    int cnt = 0, sum = 0, tot = 0, tmp = 0;
    for(int i = 1 ; i <= n ; i++){
        if(tmp == a[i]){
            cnt++;
            tot++;
        }
        else{
            sum += tot;
            tot = cnt = 1;
            tmp = a[i];
        }
        if(sum > 0){
            sum--;
            cnt--;
            ans--;
        }
        //cerr << sum << " " << ans << " " << cnt << "\n";
    }
    printf("%lld", ans);
    return 0;
}
